package virtualinit;

import com.alibaba.fastjson.serializer.JSONSerializer;
import com.alibaba.fastjson.serializer.ObjectSerializer;

import java.io.IOException;
import java.lang.reflect.Type;
import java.util.List;
import java.util.stream.Collectors;

public class DefaultSerialize implements ObjectSerializer {
    @Override
    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features) throws IOException {
        List<Ds.Table> tables = ( List<Ds.Table>)object;
        serializer.write(tables.stream().map(e->e.tableName).collect(Collectors.joining(",")));
    }
}
